home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ddj1291.zip / STAT.ZIP / SOURCE.ZIP / PADEF.H < prev    next >
C/C++ Source or Header  |  1990-05-09  |  7KB  |  160 lines

  1. /* File:    padef.h
  2. **
  3. **        Copyright 1990
  4. **        Fred Motteler and Applied Microsystems Corporation
  5. **        All Rights Reserved
  6. **
  7. ** Description:    This file contains #defines and structure definitions for the
  8. **         performance analysis module functions.
  9. */
  10.  
  11. /* Global defines */
  12. #define PA_VERSION "1.0.0"        /* Revision level */
  13. #define PAMAX 1000            /* Max. no. of globals */
  14. #define PA_SYM_LEN 17            /* Max. no. of significant chars */
  15. #define PA_LINE_LEN 160            /* Max. no. of characters in line */
  16. #define PA_BUFLEN 4096            /* Maximum number of samples */
  17.  
  18. /* Global error codes */
  19. #define PA_BAD_HEX_E -1            /* Hex digit expected */
  20. #define PA_NO_SYMBOL_E -2        /* Address value with no symbol */
  21. #define PA_EARLY_END_E -3        /* File ended unexpectedly */
  22. #define PA_TAB_FULL_E -4        /* Map table is full */
  23. #define PA_NO_MEM_E -5            /* Out of memory */
  24. #define PA_NO_WHERE_E -6        /* Can't exec "pawhere.exe" */
  25. #define PA_NO_TMP_E -7            /* Can't find "pawhere.tmp" */
  26. #define PA_BAD_TMP_E -8            /* Can't properly read "pawhere.tmp" */
  27. #define PA_TMP_RM_E -9            /* Can't remove "pawhere.tmp" */
  28. #define PA_ES_NORESP_E -10        /* ES 1800 not responding */
  29. #define PA_NO_TUP_FILE_E -11        /* Can't open file for TUP response */
  30. #define PA_NO_TUP_WR_E -12        /* Can't write to TUP response file */
  31. #define PA_NOT_IMPL_E -13        /* Function not implemented */
  32. #define PA_NO_EXEC_E -14        /* Can't exec test program */
  33. #define PA_NO_PC_FILE_E -15        /* Can't open file for pc samples */
  34. #define PA_NO_PC_WR_E -16        /* Can't write to pc sample file */
  35. #define PA_CFG_SEEK_E -17        /* Can't seek to start of cfg file */
  36. #define PA_CFG_FIELD_E -18        /* Can't find field in cfg file */
  37. #define PA_FIELD_E -19            /* Field in cfg file is empty */
  38. #define PA_BAD_DEL_E -20        /* Field has bad or no delimiter */
  39. #define PA_BAD_ORDER_E -21        /* Bad symbol value order field */
  40. #define PA_MAP_FMT_E -22        /* Bad map format specification */
  41. #define PA_BSTEP_ZERO_E -23        /* Binary search step is zero */
  42. #define PA_NO_PC_DEL_E -24        /* Can't remove pc sample file */
  43. #define PA_NO_PC_RD_E -25        /* Can't read from pc sample file */
  44. #define PA_NO_MAP_E -26            /* Can't open map file */
  45. #define PA_NO_CFG_E -27            /* Can't open the configuration file */
  46. #define PA_NO_HIT_BINS_E -28        /* No bins accumulated any hits */
  47. #define PA_BAD_ARG_E -29        /* Bad argument passed */
  48. #define PA_NO_LST_E -30            /* Can't open results listing file */
  49. #define PA_NO_DRT_FILE_E -31        /* Can't open file for DRT response */
  50. #define PA_NO_DRT_WR_E -32        /* Can't write to DRT response file */
  51. #define PA_BAD_DRT_RD_E -33        /* Can't properly read DRT data */
  52. #define PA_DCOUNT_OUT_E -34        /* DRT digit count is out of bounds */
  53. #define PA_LCOUNT_OUT_E -35        /* DRT line count is out of bounds */
  54.  
  55. /* ES 1800 emulator "basic" processor types supported */
  56. #define PA_020S 0            /* 68020 (supervisor prog. fetch) */
  57. #define PA_020U 1            /* 68020 (user prog. fetch) */
  58. #define PA_000S 2            /* 6800x/010/302 (sup. prog. fetch) */
  59. #define PA_000U 3            /* 6800x/010/302 (user prog. fetch) */
  60. #define PA_80X86 4            /* 80x8x */
  61. #define PA_Z8K 5            /* Z800x */
  62.  
  63. /* ES 1800 emulator initial/final target state conditions */
  64. #define PA_RST_RBV_STP 0        /* Use ESL "RST", "RBV", "STP" */
  65. #define PA_RBK_STP 1            /* Use ESL "RBK", "STP */
  66. #define PA_RBK_RUN 2            /* Use ESL "RBK", "RUN */
  67.  
  68. #define PA_BOMSYM "PA_BOT_MEM"        /* String to identify bottom of mem. */
  69. #define PA_TOPSYM "PA_TOP_MEM"        /* String to identify top of memory */
  70. #define PA_8086_TOP 0xfffffL        /* Top of memory address for 8086 */
  71. #define PA_68000_TOP 0xffffffL        /* Top of memory address for 68000 */
  72. #define PA_68020_TOP 0xffffffffL    /* Top of memory address for 68020 */
  73. #define PA_COMPORT "pa_comport:"    /* RS-232 port to use */
  74. #define PA_BAUDRATE "pa_baudrate:"    /* Baud rate to use */
  75. #define PA_ESTYPE "pa_estype:"        /* Type of ES 1800 emulator to use */
  76. #define PA_RUNSTOP "pa_runstop:"    /* How to "run" and "stop" target sys */
  77. #define PA_START_ID "pa_start_id:"    /* String starting symbolic info */
  78. #define PA_END_ID "pa_end_id:"        /* String ending symbolic info */
  79. #define PA_ORDER "pa_order:"        /* String giving symbol/value order */
  80. #define PA_FORMAT "pa_format:"        /* sscanf() format string sym/val */
  81. #define PA_SKIP1_ID "pa_skip1_id:"    /* String on line(s) to ignore */
  82. #define PA_SKIP2_ID "pa_skip2_id:"    /* String on line(s) to ignore */
  83. #define PA_PAGELINES "pa_pagelines:"    /* Number of lines per display page */
  84. #define PA_LISTFILE "pa_listfile:"    /* Optional list file */
  85.  
  86. #define PA_SV_ID "sym val"        /* Symbol / linear address format */
  87. #define PA_SYM_VAL 1
  88. #define PA_VS_ID "val sym"        /* Linear address / symbol format */
  89. #define PA_VAL_SYM 2
  90. #define PA_SSO_ID "sym seg:off"        /* Symbol / segmented address format */
  91. #define PA_SYM_SEG 3
  92. #define PA_SOS_ID "seg:off sym"        /* Segmented address / symbol format */
  93. #define PA_SEG_SYM 4
  94.  
  95. #define PA_SAMPLE "pasample.tmp"    /* Temporary file of pc samples. */
  96.  
  97. #define PA_NO_DEBUG 0            /* No debugging information */
  98. #define PA_SER_IN 1            /* Enable tracing of serial data in */
  99. #define PA_GENERAL 2            /* Enable general debug messages */
  100.  
  101. #define PA_BACKSPACE 8
  102. #define PA_TIMEOUT 10            /* Allow ten seconds for timeout. */
  103.  
  104.  
  105. /* Global data structures */
  106. struct padata {                /* Structure for map entries */
  107.     unsigned long addressL;        /* Starting address of module */
  108.     char symbolAB[PA_SYM_LEN];        /* Name of module */
  109.     unsigned long hitsL;        /* Number of hits in this module */
  110.     };
  111.  
  112. /* Global variables */
  113. extern struct padata *patableAHP[];    /* Table of ptrs to map data structs */
  114. extern int pa_debugN;            /* Debugging level */
  115.  
  116. /* Global functions - PC / ES 1800 independent */
  117. /* ASCII hex to binary converter. */
  118. extern int pa_hextobin();
  119. /* Comparison routine for qsort() data by number of hits per function */
  120. extern int pa_hitcomp();
  121. /* Comparison routine for qsort() and bsearch() by function address */
  122. extern int pa_addrcomp();
  123. /* Eliminate functions with zero program counter hits */
  124. extern int pa_zero_hits();
  125. /* Print error message to standard out */
  126. extern void pa_error();
  127. /* Display results in page oriented form */
  128. extern void padisply();
  129. /* Page display support routine */
  130. extern int pa_printf();
  131. /* Search for string within other string */
  132. extern char *pa_strsrch();
  133.  
  134. /* PC support functions.  Internal interrupt driven program counter sampling */
  135. /* PC interrupt CS:IP grabber support */
  136. extern void paopen();
  137. extern int paclose();
  138. /* PC ".exe." program loader locator */
  139. extern int pa_locate();
  140. /* Collect program samples from a PC program */
  141. extern int pa_pcsample();
  142.  
  143. /* ES 1800 support functions. External hardware address/status line sampling */
  144. /* Send ES 1800 a string and wait for a '>' prompt reply */
  145. extern int pa_essend();
  146. /* Send a TUP command to the ES 1800 and process the response */
  147. extern int pa_estup();
  148. /* Send a DRT command to the ES 1800 and process the response */
  149. extern int pa_esdrt();
  150. /* Collect program samples from an ES 1800 */
  151. extern int pa_essample();
  152.  
  153. /* Generic map file reader functions. */
  154. /* Read configuration file */
  155. extern int paconfig();
  156. /* Read map file and allocate space for map entries */
  157. extern int pardmap();
  158. /* Free space used by map entries */
  159. extern void paclear();
  160.